<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>房间变动记录</title>
	<link rel="stylesheet" href="js/bootstrap2/css/bootstrap.min.css">
	<link rel="stylesheet" href="js/bootstrap2/css/bootstrap-table.css">
	<link rel="stylesheet" href="css/common.css">
	<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
	<script src="js/bootstrap2/js/bootstrap.min.js"></script>
	<script src="js/bootstrap2/js/bootstrap-table.js"></script>
	<script src="js/bootstrap2/js/bootstrap-table-zh-CN.js"></script>
	<script type="text/javascript" src="js/sharefunction.js"></script>
	<style type="text/css">
		body,html{
			width: 100%;
		}
		table{
			margin-top: 5px;
		}
		.tableDiv{
			margin: 0 auto;
		}
		.checkInDate{
			margin-top: 5px;
		}
		.flag{
			color: red;
			font-weight: bold;
		}
	</style>
	<script type="text/javascript">
		$(function(){
			$("#merge_history").bootstrapTable({
				method : "post", //使用get请求到服务器获取数据  
				url : "roomInfo/findRoomMergeHistoryByCustomer", //获取数据的Servlet地址  
				striped : true, //表格显示条纹  
				pagination : true, //启动分页  
				pageSize : 10, //每页显示的记录数  
				pageNumber : 1, //当前第几页  
				pageList : [ 5, 10, 15, 20, 25 ], //记录数可选列表  
				sidePagination : "server", //表示服务端请求  
				contentType : 'application/x-www-form-urlencoded',
				//设置为undefined可以获取pageNumber，pageSize，searchText，sortName，sortOrder  
				//设置为limit可以获取limit, offset, search, sort, order  
				queryParamsType : "undefined",
				queryParams : function queryParams(params) { //设置查询参数  
					var param = {
						pageNumber : params.pageNumber,
						pageSize : params.pageSize,
						cId : '${requestScope.cId}',
						roomId : '${requestScope.roomId}'
					};
					return param;
				},
				columns : [ {
					field : 'beMergeRoom',
					title : '房间号',
					width : '30%'
				},{
					field : 'status',
					title : '操作',
					width : '80px'
				},{
					field : 'createDate',
					title : '操作时间',
					width : '25%',
					formatter:carDataFormat
				}, {
					field : 'remark',
					title : '备注'
				}]
			});
		});
		//日期格式化
		function carDataFormat(value, row, index) {
			return new Date(row.createDate).format("yyyy-MM-dd");
		}	
	</script>
</head>
<body>
	<div class="tableDiv">
		<table id="merge_history" ></table>
	</div>
	<div class="checkInDate">
		<span>
			<span class="flag">*入住时间:</span>
			<fmt:formatDate value="${requestScope.checkInDate}" pattern="yyyy-MM-dd hh:mm:ss" />
		</span>
	</div>
</body>
</html>